class Solution
{
public:
    vector<int> getRow(int rowIndex)
    {
        vector<int> result(rowIndex + 1, 1);
        for (int i = 1; i <= rowIndex; ++i)
        {
            result[i] = result[i - 1] * static_cast<long long>(rowIndex - i + 1) / i;
        }
        return result;
    }
};